﻿@inherits LayoutComponentBase

<MudRTLProvider RightToLeft="@_rightToLeft">
    <MudThemeProvider Theme="_currentTheme" />
    <MudDialogProvider />
    <MudSnackbarProvider />
    <AuthorizeView>
        <NotAuthorized>
            <MudAppBar Elevation="0" Style="background:#6e6e6e00!important">
                <ThemeDrawer @bind-ThemeDrawerOpen="_themeDrawerOpen" ThemePreference="_themePreference"
                    ThemePreferenceChanged="ThemePreferenceChanged" />
                <ThemeButton OnClick="@(() => _themeDrawerOpen = true)" />
            </MudAppBar>
            <MudContainer MaxWidth="MaxWidth.Small" Class="d-flex align-center" Style="height: 100vh;">
                <MudPaper Elevation="25" Class="pa-8"> 
                    @Body
                </MudPaper>
            </MudContainer>
        </NotAuthorized>
        <Authorized>
            <NotificationConnection>
                <MudLayout>
                    <ThemeDrawer @bind-ThemeDrawerOpen="_themeDrawerOpen" ThemePreference="_themePreference"
                        ThemePreferenceChanged="ThemePreferenceChanged" />
                    <ThemeButton OnClick="@(() => _themeDrawerOpen = true)" />
                    <MainLayout>
                        @Body
                    </MainLayout>
                </MudLayout>
            </NotificationConnection>
        </Authorized>
    </AuthorizeView>
</MudRTLProvider>